package cn.q3c.parse.stock2.impl;

import java.util.List;

import org.apache.log4j.Logger;

import cn.keyvalue.ccf.common.util.ObjectUtils;
import cn.q3c.parse.base.BaseProcess;
import cn.q3c.parse.stock2.object.StockTradeLog;

/**
 * 股票数据库处理类
 * @author wangxinning
 *
 */
public class Stock2DBProcessImpl implements BaseProcess{

	private static final Logger logger = Logger.getLogger(Stock2DBProcessImpl.class);

	public boolean process(Object obj) {
				
		@SuppressWarnings("unchecked")
		List<StockTradeLog> stockTradeLogList = (List<StockTradeLog>)obj;
		
		logger.debug("stockTradeLogList:" + stockTradeLogList);
		
		// 处理日志列表（一只股票一天的交易数据）
		if (!ObjectUtils.isEmptyList(stockTradeLogList)) {
			Stock2ParseImpl.stockService.processTradeOneDay(stockTradeLogList);
		}		
		
		logger.debug("交易入库成功");

		return true;
	}
}
